package com.sq.partner.manager.dao.impl;

import com.sq.partner.manager.dao.HaidaInfoDao;
import com.sq.partner.manager.mybatis.model.HaidaInfo;
import com.sq.partner.manager.util.Page;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * author lxy
 * 2022/4/2 16:09
 */
@Repository
public class HaidaInfoDaoImpl extends BaseDaoImpl implements HaidaInfoDao {
	@Override
	public Page queryHaidaReconciliationPage(Page page) throws Exception {
		Map<String, Object> map = (Map<String, Object>) page.getType();
		long queryCount = (Long) this.query("queryCountHaidaPolicyByMap", map);
		List<HaidaInfo> list = queryList("queryPolicyOfHaidaByMap", map);
		page.setTotal(queryCount);
		page.setData(list);
		return page;
	}
	
	@Override
	public List<HaidaInfo> queryHaidaReconciliationList(Map<String, Object> map) throws Exception {
		return queryList("queryPolicyOfHaidaByMap", map);
	}
	
	@Override
	public long queryHaidaReconciliationCount(Map<String, Object> map) throws Exception {
		return (Long) this.query("queryCountHaidaPolicyByMap", map);
	}
}
